<!DOCTYPE HTML>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<link rel="stylesheet" href="../css/currency/bootstrap.css" />
	<link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="../css/style.css" rel="stylesheet" type="text/css" />
	<link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="../css/recipe.css" />	
	<title>广告内容管理</title>
	<style>
		.errorInfo {
			color: red;
			font-size: 10px;
			line-height: 13px;
		}

	</style>
	</head>

	<body>
	<nav class="breadcrumb" style="margin-bottom:0px"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基础功能 <span class="c-gray en">&gt;</span>广告内容管理列表
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
    <div class="pd-20" id="advInfo">
        <div class="text-c" id="advInfoList">
            <form search-form>
                <!-- TODO 根据业务需要修改搜索内容-->
                <input type="text" class="input-text" style="width:250px" v-model="condition.key" placeholder="编号/名称" >
				<span class="select-box" style="width:150px;">
                    <select id="cameFrom" class="select" v-model="condition.cameFrom">
                        <option value="">-请选择广告来源-</option>
                        <option value="1">奥森平台</option>
                        <option value="2">美数平台</option>
						<option value="3">百度平台</option>
						<option value="4">点屏平台</option>
						<option value="5">易售平台</option>
						<option value="6">钼媒平台</option>
                    </select>
                </span>
				<span class="select-box" style="width:150px;">
                    <select id="advType" class="select" v-model="condition.advType">
                        <option value="">-请选择广告类型-</option>
                        <option value="2">待机广告</option>
						<option value="3">普通广告-小视频1200×765</option>
						<option value="4">普通广告-大图片1200*1600</option>
						<option value="5">普通广告-小图片1200×765</option>
						<option value="6">背景音乐</option>
						<option value="7">底部广告</option>
						<option value="8">普通广告-大视频1200*1600</option>
                    </select>
                </span>
				<span class="select-box" style="width:150px;">
                    <select id="status" class="select" v-model="condition.status">
                        <option value="">-请选择状态-</option>
                        <option value="1">有效</option>
                        <option value="0">无效</option>
                    </select>
                </span>
				<input id="hiddenText" type="text" style="display:none" class="input-text">
                <div id="selectBtnEnter" class="btn btn-primary" v-on:click="getList('search')">查询</div>
            </form>
	        <div class="cl pd-5 bg-1 bk-gray mt-20">
	            <span class="l">
	                <a class="btn btn-primary radius addFormula" id="addButton" v-on:click="addOrUpdatePanel('add')">添加</a>
	            </span>
	            <span class="r" v-cloak>
	            	共有数据：{{pageInfo.total}}条
	            </span>
	        </div>
	        <form >
	            <table class="table table-border table-bordered table-bg">
	                <thead>
	                <tr class="text-c">
	                <!--TODO 生成表头-->
						<th nowrap="nowrap" width='7.091%'>广告ID</th>
						<th nowrap="nowrap">外部ID</th>
						<th nowrap="nowrap" width='7.091%'>广告名称</th>
						<th nowrap="nowrap" width='7.091%'>广告来源</th>
						<th nowrap="nowrap" width='7.091%'>广告类型</th>
						<th nowrap="nowrap" width='7.091%'>状态</th>
						<th nowrap="nowrap" width='7.091%'>预览广告</th>
						<th nowrap="nowrap" width='7.091%'>文件大小</th>
						<!--<th nowrap="nowrap" width='7.091%'>预览</th>-->
						<th nowrap="nowrap" width='7.091%'>操作人</th>
						<th nowrap="nowrap" width='7.091%'>操作时间</th>
						<th nowrap="nowrap" width='16.091%'>操作</th>
	                </tr>
	                </thead>
	                <tbody v-cloak >
	                    <tr class="text-c" v-for="(item,index) in pageInfo.list">
							<td nowrap="nowrap">{{item.advCode}}</td>
							<td nowrap="nowrap">{{item.cid}}</td>
							<td nowrap="nowrap">{{item.advName}}</td>
							<td>
								<span v-if="item.cameFrom==1">奥森平台</span>
								<span v-if="item.cameFrom==2">美数平台</span>
								<span v-if="item.cameFrom==3">百度平台</span>
								<span v-if="item.cameFrom==4">点屏平台</span>
								<span v-if="item.cameFrom==5">易售平台</span>
								<span v-if="item.cameFrom==6">钼媒平台</span>
							</td>
							<td nowrap="nowrap">
								<span v-if="item.advType==2">待机广告</span>
								<span v-if="item.advType==3">普通广告-小视频1200×765</span>
								<span v-if="item.advType==4">普通广告-大图片1200*1600</span>
								<span v-if="item.advType==5">普通广告-小图片1200×765</span>
								<span v-if="item.advType==6">背景音乐</span>
								<span v-if="item.advType==7">底部广告</span>
								<span v-if="item.advType==8">普通广告-大视频1200*1600</span>
							</td>
							<td nowrap="nowrap">
								<span v-if="item.status==0">无效</span>
								<span v-if="item.status==1">有效</span>
							</td>
							<td nowrap="nowrap">
								<span v-if="item.url != '' && item.url != null">
									<span v-if="item.advType==3">
										<a @click="openVideo(item.url)" target="_blank" class="btn btn-link" :title="item.url">
											<span>预览广告资源</span>
										</a>
									</span>
									<span v-if="item.advType!=3">
										<a :href="item.url" target="_blank" class="btn btn-link" :title="item.url">
											<span>预览广告资源</span>
										</a>
									</span>
								</span>
							</td>
							<!--<td nowrap="nowrap">
								<span v-if="item.voice != '' && item.voice != null">
									<a @click="openVideo(item.voice)" target="_blank" class="btn btn-link" :title="item.voice">
										<span>预览背景音乐</span>
									</a>
								</span>
							</td>-->
							<td nowrap="nowrap">
								<span v-if="item.fileSize!=null">
								{{item.fileSize}}KB
								</span>
							</td>
							<td nowrap="nowrap">{{item.updatedBy}}</td>
							<td nowrap="nowrap">{{item.updatedDate}}</td>
							<td>
								<span v-if="item.cameFrom==1">

									<a class="btn btn-primary radius" @click="updateInit(index)">修改</a>
								    <!--<a @click="updateStatus(index)">-->
									  <!--<span class="btn btn-success radius" v-if="item.status=='1'">失效</span>-->
									  <!--<span class="btn btn-primary radius" v-else>生效</span>-->
								    <!--</a>-->
									<a class="btn btn-success radius" @click="delAdv(item.id)">删除</a>
								</span>
							</td>
	                    </tr>
	                </tbody>
	            </table>
	        </form>
        
	        <div class="pageBox" v-cloak id="pageBox" >
	        	<div class="pageInfo">显示 <span id="startRow">{{pageInfo.startRow}}</span> 到 <span id="endRow">{{pageInfo.endRow}}条</span>&nbsp;&nbsp;&nbsp;&nbsp;{{pageInfo.pages}}页&nbsp;&nbsp;&nbsp;&nbsp;共 <span id="total">{{pageInfo.total}}</span> 条
	                <select v-model="selectedPageSize" v-on:change="getList('changePageSize')">
						<option value="5">5</option>
	                    <option value="10">10</option>
	                    <option value="15">15</option>
	                    <option value="20">20</option>
	                    <option value="50">50</option>
	                </select>
	             </div>
	        	<ul class="pagination" id="pagination"></ul>
	        </div>
	        <div class="tips"  id="noData" align="center" style="display: none">
	        	无数据
	        </div>
        </div>

	    	<!--TODO 添加、更新弹窗-->
	        <form class="form form-horizontal" id="addPanel" style="display: none" enctype="multipart/form-data">
				<input name="id" v-model="field.id" type="hidden">
	        <table class="table" border='0' width='100%'>
	            <tr>
				    <td width="30%" align="right" nowrap="nowrap"></td>
				    <td width="30%" style="margin-left: 0px"></td>
				    <td width="40%" ></td>
				</tr>
			    
			    
			    <tr class="t1">
				    <td  align="right" nowrap="nowrap">
				        <label class="form-label" style="padding:0px" >
				            <span class="c-red">*</span>广告编号：
				        </label>
				    </td>
				    <td >
				        <input type="text" class="input-text radius" name="advCode" readonly="readonly" v-model="field.advCode" placeholder="请填写广告编号"  />
				    </td>

				    <td  ><span class="Validform_checktip Validform_wrong errorInfo" v-if="err.advCodeErr!=''">{{err.advCodeErr}} </span></td>
				</tr>
			    
			    <tr>
				    <td  align="right" nowrap="nowrap">
				        <label class="form-label" style="padding:0px">
				            <span class="c-red">*</span>广告名称：
				        </label>
				    </td>
				    <td >
				        <input type="text" class="input-text radius" name="advName" v-model="field.advName" placeholder="请填写广告名称" />
				    </td>
				    
				    <td  ><span class="Validform_checktip Validform_wrong errorInfo" v-if="err.advNameErr!=''">{{err.advNameErr}} </span></td>
				</tr>

				<tr>
					<td  align="right" nowrap="nowrap">
						<label class="form-label" style="padding:0px">
							<span class="c-red"></span>广告来源：
						</label>
					</td>
					<td >
						<label style="font-weight: normal;">奥森平台</label>
						<!--<input type="text" class="input-text radius" name="advName" v-model="field.advName" placeholder="请填写广告名称" />-->
					</td>
				</tr>

			    <tr>
				    <td  align="right" nowrap="nowrap">
				        <label class="form-label" style="padding:0px">
				            <span class="c-red">*</span>广告类型：
				        </label>
				    </td>
				    <td >
						<select class="select" name="advType" v-model="field.advType" @change="typeChange" >
							<!--<option :value="2">待机广告</option>-->
							<option :value="3">普通广告-视频1200×765</option>
							<option :value="4">普通广告-图片1200×1600</option>
							<option :value="5">普通广告-图片1200×765</option>
							<option :value="6">背景音乐</option>
							<option :value="7">底部广告</option>
							<option :value="8">普通广告-大视频1200*1600</option>
						</select>
				    </td>

				    <td  ><span class="Validform_checktip Validform_wrong errorInfo" v-if="err.advTypeErr!=''">{{err.advTypeErr}} </span></td>
				</tr>
			    <tr id="t1">
				    <td  align="right" nowrap="nowrap">
				        <label class="form-label" style="padding:0px" id="tl">广告资源：</label>
				    </td>
				    <td>
				        <input type="file" id="topImg" class="radius" multiple="multiple" name="files" />
				    </td>

				    <td  ><span class="Validform_checktip Validform_wrong errorInfo" v-if="err.topImgErr!=''">{{err.topImgErr}} </span></td>
				</tr>

				<tr id="t2">
					<td  align="right" nowrap="nowrap">
						<label class="form-label" style="padding:0px" id="ml">背景音乐：</label>
					</td>
					<td>
						<input type="file" id="middleVideo" class="radius" multiple="multiple" name="files" />
					</td>

					<td  ><span class="Validform_checktip Validform_wrong errorInfo" v-if="err.middleVideoErr!=''">{{err.middleVideoErr}} </span></td>
				</tr>

				<tr>
					<td class="text-r" ></td>
				    <td class="text-c" >
				    	<a class="btn btn-primary radius" id="addCancel" v-on:click="reset">取消</a>
				        <a class="btn btn-primary radius"  id="saveDictType" v-on:click="save">保存</a>
				    </td>
				    <td></td>
				</tr>
	        </table>
	        </form>

		<!--<div id="showPanel" style="display: none" >-->

			<!--<video src="" autoplay="autoplay"  controls="controls"></video>-->
		<!--</div>-->
    </div>
	</body>

</html>
<script type="text/javascript" src="../js/common/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../lib/layer/1.9.3/layer.js" ></script>
<script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="../lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/common/H-ui.js"></script>
<script type="text/javascript" src="../js/common/H-ui.admin.js"></script>
<script type="text/javascript" src="../js/utils/utils.js"></script>
<script type="text/javascript" src="../js/currency/vue.js"></script>
<script type="text/javascript" src="../js/currency/vue-resource.min.js"></script>
<script type="text/javascript" src="../js/currency/base.js"></script>
<script type="text/javascript" src="../js/currency/jqPaginator.js"></script>
<script type="text/javascript" src="../js/advInfo.js"></script>
